#ifndef GQUEUE_H_
#define GQUEUE_H_

#include <stdlib.h>
#include <string.h>

#include "utypes.h"

/** @defgroup GQueue GQueue
 * @{
 *
 * Queue related functions
 */

/** GQueue structure.
 */
typedef struct{
	void *ptr;    ///< void pointer
	int in;       ///< In
	int out;      ///< Out
	int count;    ///< Count
	int size;     ///< Size of queue
	int ele_size; ///< Size of element
} GQueue;

/** Initiates new queue structure parameters, with "n_ele" elements 
 *each one with size "ele_size"
 */
GQueue* newGQueue(int n_ele, int ele_size);

/** Delete GQueue
 */
void deleteGQueue(GQueue* q);

/** Put element GQueue
 */
Bool putGQueue(GQueue* q, void* ele);

/** Look at the top element
 */
void* peekGQueue(GQueue* q);

/** Pops the top element
 */
void* getGQueue(GQueue* q);

/** Clear GQueue
 */
void clearGQueue(GQueue* q);

/** Checks if the GQueue is empty
 */
Bool isEmptyGQueue(GQueue* q);

/** Checks if the GQueue is full
 */
Bool isFullGQueue(GQueue* q);

/** @} end of GQueue */

#endif
